<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>target option of sliphover</title>
        <link rel="stylesheet" href="css/main.css">
         <style>
    .item{
        width:200px;
        height:200px;
        display: inline-block;
        -webkit-transition: all 0.3s ease-out;
    }
    </style>
    </head>
    <body >
    <div class="wrapper">
    
        <!-- demo begin -->
        <div class="demo" id="container">
        </div>
        <!-- demo end -->

        <div class="des">
<p>The overlay can be applied to any element on the page, not only images. Just tell sliphover the target elements by passing any valid css selector.</p>

    </div>
        <div class="code">
        <div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span style="color: #f92672">&lt;div</span> <span style="color: #a6e22e">id=</span><span style="color: #e6db74">&quot;container&quot;</span><span style="color: #f92672">&gt;</span>
    <span style="color: #f92672">&lt;div</span> <span style="color: #a6e22e">class=</span><span style="color: #e6db74">&quot;item&quot;</span> <span style="color: #a6e22e">data-caption=</span><span style="color: #e6db74">&quot;this is the caption&quot;</span><span style="color: #f92672">&gt;&lt;/div&gt;</span>
    <span style="color: #f92672">&lt;div</span> <span style="color: #a6e22e">class=</span><span style="color: #e6db74">&quot;item&quot;</span> <span style="color: #a6e22e">data-caption=</span><span style="color: #e6db74">&quot;this is the caption&quot;</span><span style="color: #f92672">&gt;&lt;/div&gt;</span>
    <span style="color: #f92672">&lt;div</span> <span style="color: #a6e22e">class=</span><span style="color: #e6db74">&quot;item&quot;</span> <span style="color: #a6e22e">data-caption=</span><span style="color: #e6db74">&quot;this is the caption&quot;</span><span style="color: #f92672">&gt;&lt;/div&gt;</span>
    ...
<span style="color: #f92672">&lt;/div&gt;</span>
</pre></div>
       <div class="highlight" style="background: #272822"><pre style="line-height: 125%"> <span style="color: #a6e22e">$</span><span style="color: #f8f8f2">(</span><span style="color: #66d9ef">function</span><span style="color: #f8f8f2">()</span> <span style="color: #f8f8f2">{</span>

     <span style="color: #a6e22e">$</span><span style="color: #f8f8f2">(</span><span style="color: #e6db74">&#39;#container&#39;</span><span style="color: #f8f8f2">).</span><span style="color: #a6e22e">sliphover</span><span style="color: #f8f8f2">({</span>
         <span style="color: #a6e22e">target</span><span style="color: #f92672">:</span> <span style="color: #e6db74">&#39;.item&#39;</span><span style="color: #f8f8f2">,</span>
         <span style="color: #a6e22e">caption</span><span style="color: #f92672">:</span> <span style="color: #e6db74">&#39;data-caption&#39;</span>
     <span style="color: #f8f8f2">});</span>
 <span style="color: #f8f8f2">})</span>
</pre></div>
    </div>
    </div>
    
        <script src="js/jquery-1.11.1.min.js"></script>
        <script src="js/randomColor.js"></script>
  <script src="js/jquery.sliphover.min.js"></script>

        <script type="text/javascript">
          $(function(){
        
        var $fragment = $('<div>'),
                 temp, colors = randomColor({
                     luminosity: 'light',
                     count: 12
                 });

             $.each(colors, function(i, v) {
                 temp = $('<div>', {
                     class: 'item',
                     'data-caption':v
                 }).css({
                     backgroundColor: v
                 });
                 $fragment.append(temp);
             })
             $('#container').append($fragment);
             
             //call sliphover
             $('#container').sliphover({
                target:'.item',
                caption:'data-caption'
             });
        })
        </script>
        <script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-46794744-6', 'auto');
  ga('send', 'pageview');

</script>
    </body>
</html>